﻿
<!DOCTYPE html>
<html>
    <head>
        <title>Chèn nội dung</title>
        <!-- Make sure the path to CKEditor is correct. -->
        <script src="ckeditor/ckeditor.js"></script>
    <link href="Content/bootstrap.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">
    </head>
    <body>
        <form action="index.html" method="post">
            <div class="col-md-12" style="padding:10px;">
                <textarea name="noidung" id="noidung" rows="10" cols="80">
                </textarea>
            </div>
            <div class="col-md-12" style="padding:10px;">
                <input type="button" class="btn btn-default" value="Hoàn thành" onclick="abc();" />
            </div>
            <script>
                CKEDITOR.replace('noidung');
                if (this.name == 'Popup') {
                    document.getElementById('noidung').value = window.opener.document.getElementById("archier").value;
                }
                else if (this.name == 'Popup1') {
                    document.getElementById('noidung').value = window.opener.document.getElementById("archier1").value;
                }
                else if (this.name == 'Popup2') {
                    document.getElementById('noidung').value = window.opener.document.getElementById("archier2").value;
                }
            </script>
        </form>
        <script>
            function abc() {
                if (window.opener != null && !window.opener.closed) {
                    var editorText = CKEDITOR.instances.noidung.getData();
                    if (this.name == 'Popup') {
                        window.opener.document.getElementById("archier").value = editorText;
                    }
                    else if (this.name == 'Popup1') {
                        window.opener.document.getElementById("archier1").value = editorText;
                    }
                    else if (this.name == 'Popup2') {
                        window.opener.document.getElementById("archier2").value = editorText;
                    }
                }
                window.close();
            }
        </script>
        <script src="Scripts/jquery 1.7.1.js"></script>
        <script src="Scripts/bootstrap.js"></script>
        <script src="Scripts/fb.js"></script>
    </body>
</html>